import request from './request';

export function getProductList(params) {
  return request({
    url: '/product',
    method: 'get',
    params
  });
}

export function getProductById(id) {
  return request({
    url: `/product/${id}`,
    method: 'get'
  });
}

export function createProduct(data) {
  return request({
    url: '/product',
    method: 'post',
    data
  });
}

export function updateProduct(data) {
  return request({
    url: '/product',
    method: 'put',
    data
  });
}

export function deleteProduct(id) {
  return request({
    url: `/product/${id}`,
    method: 'delete'
  });
}
